refactor(maps): port to MapLibre GL JS and add pmtiles-server example#364
Open
dschmidt wants to merge 5 commits intoopencloud-eu:mainfrom
Open
refactor(maps): port to MapLibre GL JS and add pmtiles-server example#364dschmidt wants to merge 5 commits intoopencloud-eu:mainfrom
dschmidt wants to merge 5 commits intoopencloud-eu:mainfrom
Conversation
Replace Leaflet + leaflet-gpx with MapLibre GL JS for WebGL-based rendering, vector tile support, and PMTiles support. - Add GPX parsing helper using @tmcw/togeojson with haversine distance and elevation gain/loss calculation - Support raster tiles (default OSM), PMTiles with lazy protocol registration, and full style override via mapStyle config - Add configurable tile attribution via tileLayerAttribution - Fix bug where imperial units were displayed with metric labels - Update CSP to allow MapLibre web workers and tile fetching - Update e2e tests with new selectors and additional coverage
Adds a self-contained docker compose setup in contrib/pmtiles-server/ that downloads PMTiles and font glyphs, then serves them via a static web server on port 9205. Supports resuming interrupted downloads.
Read the language from document.documentElement.lang so map labels match the user's OpenCloud language setting, falling back to English.
Add background, blur, shadow and spacing to the GPX metadata overlay so it's readable over the map. Also allow mapStyle config to accept an inline style object in addition to a URL string.
16f95eb to
550f265
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR ports the maps app from Leaflet.js (thanks for all the fish up until here :)) to MapLibre GL JS which is a more modern library, with better TypeScript support and built in
.pmtilessupport.PMTiles is a container format for vector maps. You can serve the whole world as a single .pmtiles file and the browser will request just what it needs with range requests.
This makes it very easy to deploy it yourself. To show how easy it is, I've added an example pmtiles-server which automatically downloads a world map from protomaps on startup.
Related Issue
How Has This Been Tested?
Types of changes